package com.dataart.productshop.model.boiko.informationsystem;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.Date;
import java.util.List;

@Entity
@Table(name = "student")
public class Student {

    @Id
    @GeneratedValue
    @Column(nullable = false)
    private Long id;

    @Column(nullable = false)
    private String name;

    @Column(name = "date_enter", nullable = false)
    private Date dateEnter;

    @Column(name = "date_finish", nullable = false)
    private Date dateFinish;

    @ManyToOne
    @JoinColumn(name = "kathedra_id")
    Kathedra kathedra;

    @OneToMany(mappedBy = "student")
    private List<Gpa> gpas;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getDateEnter() {
        return dateEnter;
    }

    public void setDateEnter(Date dateEnter) {
        this.dateEnter = dateEnter;
    }

    public Date getDateFinish() {
        return dateFinish;
    }

    public void setDateFinish(Date dateFinish) {
        this.dateFinish = dateFinish;
    }

    public Kathedra getKathedra() {
        return kathedra;
    }

    public void setKathedra(Kathedra kathedra) {
        this.kathedra = kathedra;
    }

    public List<Gpa> getGpas() {
        return gpas;
    }

    public void setGpas(List<Gpa> gpas) {
        this.gpas = gpas;
    }
}
